<script setup lang="ts">
defineProps<{ msg: string }>()

const count = ref(0)
const atRules = ['@use', '@forward', '@import', '@mixin and @include', '@function', '@extend', '@error', '@warn', '@debug', '@at-root']
const flowControls = ['@if', '@each', '@for', '@while']

</script>

<template>
  <h1 class="title">{{ msg }}</h1>
  <button class="btn" type="button" @click="count++">count is {{ count }}</button>
<div class="card micro">
  <el-row>
    <el-col :span="16">
      <ul class="list">
        <li v-for="rule in atRules">{{ rule }}</li>
      </ul>
    </el-col>
    <el-col :span="8">
      <h4 :style="{ textAlign: 'left', marginBottom: 0 }">流程控制</h4>
      <ul class="flows">
        <li v-for="item in flowControls">{{ item }}</li>
      </ul>
    </el-col>
  </el-row>
</div>
  <p>
    Check out
    <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite
    starter
  </p>
  <p>
    Install
    <a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
    in your IDE for a better DX
  </p>
  <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>

<style scoped lang="scss">
$bgColor: #ff00cc;
$rounded: true;
$width: 50px, 300px, 100px;

.title {
  font-size: 32px;
  user-select: none;
  margin: 0;
}

.card {
  padding: 8px;
  border-radius: if($rounded, 8px, null);
  background-color: var(--el-fill-color-light);
}

.micro {
  width: sum($width...);
}

.btn {
  @extend %button;
  background-color: $bgColor;
}

.read-the-docs {
  color: #888;
}

.list {
  padding-left: 24px;

  @include list(li, $color-white, $color-primary) {
    margin: 8px 0;
  }
}

.flows {
  padding-left: 24px;
  font-size: 12px;

  @include list(li, $color-white, $color-success) {
    margin: 8px 0;
  }
}
</style>
